<button class="glow-btn">立即体验</button>

<style>
.glow-btn {
  position: relative;
  padding: 12px 40px;
  font-size: 16px;
  color: #fff;
  background: #333;
  border: none;
  border-radius: 8px;
  overflow: hidden; /* 关键：隐藏溢出部分 */
  cursor: pointer;
}

.glow-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%; /* 初始位置在左侧外 */
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.5),
    transparent
  );
  transition: left 0.7s ease; /* 平滑过渡 */
}

.glow-btn:hover::after {
  left: 100%; /* 悬停时移动到右侧外 */
}
</style>